<template>
  <div>
    <div class="dashboard-container">find_or_create {{ find_or_create }}</div>
    <div class="dashboard-container">main_partner {{ main_partner }}</div>
    <div class="dashboard-container">行数 {{ count }}</div>

    <div class="app-container">
      ssss
      <ListPage :model-name="modelName" :detail-page="detailPage" />
    </div>
  </div>
</template>

<script>
import odoo from '@/odooapi'

import ListPage from '@/selfComponents/ListPage'

//

const modelName = 'Test/ResPartner'
const detailPage = 'res-partner-detail'

export default {
  name: 'Home',
  components: { ListPage },
  directives: {},
  filters: {},

  data() {
    return {
      modelName: modelName,
      Model: undefined,
      detailPage: detailPage,

      list: [],
      count: 0,
      main_partner: null,
      find_or_create: null
    }
  },
  computed: {},
  async created() {
    this.Model = odoo.env(this.modelName)

    this.main_partner = await this.Model.main_partner()
    this.find_or_create = await this.Model.find_or_create('12313@123.com')
    this.count = await this.Model.search_count([])
    // const sss = await this.Model.search()
  }
}
</script>
